<script>
import panelModules from './modules';

/*
 * 模块包装器，用来创建动态组件
 */
export default {
  name: 'ModuleWrapper',
  components: panelModules,
  props: {
    //模块类型
    type: {
      type: String,
      default() {
        return 'div';
      },
    },
    //模块选项
    options: {
      type: Object,
      default: () => {},
    },
  },
  render(createElement) {
    return createElement(this.type, {
      props: this.options,
    });
  },
};
</script>
